//
//  GYPayment.m
//  GoodLuck
//
//  Created by 丁燕春 on 2018/4/6.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYPayment.h"

@implementation GYPayment

+ (NSArray *)jsonPatmentInfo:(NSArray *)source {
    NSMutableArray *models = [NSMutableArray array];
    for (NSDictionary *dic in source) {
        NSString *payment_code = [dic objectForKey:@"payment_code"];
        if ([payment_code isEqualToString:@"alipay"] || [payment_code isEqualToString:@"wxpay"]) {
            GYPayment *model = [[GYPayment alloc] initWithDic:dic];
            //model.selected = NO;
            [models addObject:model];            
        }
    }
    
    return models;
}

- (instancetype)initWithDic:(NSDictionary *)dic {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (NSString *)description {
    NSArray *keys = @[@"payment_code",@"payment_config",@"payment_id",@"payment_name",@"payment_state",@"payment_state_text"];
    
    return [NSString stringWithFormat:@"%@ ",[self dictionaryWithValuesForKeys:keys]];
}

















@end
